home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / tc_crit.zip / CRITTER.DOC < prev    next >
Text File  |  1989-10-07  |  5KB  |  117 lines

  1.  
  2.  
  3.                                CRITTER.DOC
  4.                               (October 1989)
  5.  
  6.  
  7.                       No Copyright 1989, John Crouch
  8.                        Copywrong 1989, John Crouch
  9.  
  10.                    (And any other cute way to say it's
  11.                      public doman and it's all yours)
  12.  
  13.  
  14.  
  15.       CRITTER.C is a small program written for Turbo C users.  It is
  16.       intended to handle the DOS Critical Error Interrupt with a graceful
  17.       CXL window oriented error message.
  18.  
  19.       I compiled it with CXL 5.1 and Turbo C 2.0 it seems to work fine.  I
  20.       have included a lot of information about DOS and it's errors in the
  21.       source file.  With this information you should be able to modify the
  22.       source code to make this program work exactly as you would like it
  23.       to work.
  24.  
  25.  
  26.  
  27.       In Turbo C there is a function named harderr().  This function
  28.       allows you to install your own function to be called by DOS when a
  29.       DOS Critical Error occurs.  One example of a DOS critical error is
  30.       when you try to access drive A: and there is no floyy in the disk
  31.       drive.  DOS usually prompts "Abort, Retry, Ignore".  This can really
  32.       mess up a nice looking window display!
  33.  
  34.  
  35.       CRITTER.C contains a function named handler().  This function is
  36.       meant to be taken out of this source file and inserted into your
  37.       application.  CRITTER.C is a testing program for the handler
  38.       function.  The main() function in CRITTER.C installs this as the
  39.       critical error handler and then tries to access either the AUX port
  40.       (COM1), or do a findfirst() on a path name you specify on the
  41.       command line.
  42.  
  43.                          Syntax:  CRITTER [path]
  44.  
  45.                            Example: CRITTER A:\
  46.  
  47.  
  48.       Try this with no disk in drive A: and you should get a nice looking
  49.       window popup telling you the error and allowing you to do a Retry,
  50.       Abort, etc.
  51.  
  52.       The handler() function is rather smart at this time.  If it is a
  53.       drive error it figures out which drive was in error and tells you.
  54.       It determines if it was a Write or Read error too.  If it was a
  55.       device, like AUX or COM1 or COM2 or PRN, it will tell you that too.
  56.  
  57.  
  58.       This handler can be expanded by you if you feel like taking the time
  59.       to do some work on it.  I have included a lot of information on DOS
  60.       and it's error handler function which will allow you to understand
  61.       what I have already written, and allow you to write your own changes
  62.       to the routine.
  63.  
  64.  
  65.             !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  66.  
  67.  
  68.       PLEASE NOTE:  This program will only work with the small data
  69.       models.  Meaning the small and medium libraries.
  70.  
  71.       Why???  When the program is inside the DOS critical error handler,
  72.       it is not allowed to call any DOS function above 0x0C.  If it does,
  73.       the program will end up crashing when you return from the handler.
  74.       This is just the way DOS works.  Well, from what I can tell CXL
  75.       calls malloc() to allocate memory for a lot of the window functions.
  76.       When malloc() is used in the large data models, malloc() actually
  77.       ends up calling a DOS function (above 0x0C) to allocate some memory
  78.       from DOS.  This makes the program crash into the ground when it
  79.       returns from the handler.
  80.  
  81.       But, the program works fine in the small and medium memory models.
  82.  
  83.  
  84.       Good luck and have fun.  If you like experimenting with these kinds
  85.       of hard-to-code programs, be my guest and have some fun.  I wish I
  86.       could fine a way to make this thing work with the large memory
  87.       models.  If you do, please upload a copy to the CXL Support BBS.
  88.  
  89.  
  90.       THIS CODE IS FREE!  USE IT AS YOU WISH.  USE IT, CHANGE IT, EAT IT,
  91.       BURN IT, DO WHATEVER YOU WANT WITH IT, JUST DON'T USE MY NAME WHEN
  92.       YOU DO!  IT BELONGS TO NOBODY, ESPECIALLY _NOT_ ME!  I WILL NOT BE
  93.       HELD RESPONSIBLE FOR IT'S GREATNESS OR IT'S NOT-SO-GREATNESS IN ANY
  94.       WAY!!!
  95.  
  96.       If you would like to chat about this code, I can be found in the
  97.       following places in order of the my visiting frequency.
  98.  
  99.  
  100.       The New Micro Connection BBS (301-698-0212  1200-14400 HST  8-N-1)
  101.       The RelayNet Mail Network    (C Conference)
  102.       Interlink Mail Network       (C Conference)
  103.       CXL Tech Support BBS         (512-590-0460  1200-14400 HST  8-N-1)
  104.       CompuServe ID# 71310,2612    (EasyPlex Mail)
  105.  
  106.  
  107.  
  108.       One word about CXL.  GREAT!  One word does not describe the CXL
  109.       Function Library!  Mike Smedley has done a great job with this
  110.       library.  I have used other Shareware libraries and commercial
  111.       libraries, both costing much more than CXL, and have found CXL to be
  112.       superior in every way!  It's amazing what kind of programs you can
  113.       crank out in a short time with the CXL library at your side.  If you
  114.       have not registered CXL yet, do it today!  I can think of a lot
  115.       worse ways to spend $35.
  116.  
  117.